using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CPlatePrintSys.Domain.Models;

namespace CPlatePrintSys.Domain.Services
{
    /// <summary>
    /// 工作空间服务接口（仅本地存储）
    /// </summary>
    public interface IWorkSpaceService
    {
        /// <summary>
        /// 获取所有工作空间记录
        /// </summary>
        Task<List<WorkSpace>> GetAllWorkSpacesAsync();

        /// <summary>
        /// 根据ID获取工作空间
        /// </summary>
        Task<WorkSpace> GetWorkSpaceByIdAsync(int id);

        /// <summary>
        /// 创建新工作空间
        /// </summary>
        Task<WorkSpace> CreateWorkSpaceAsync(WorkSpace workSpace);

        /// <summary>
        /// 更新工作空间
        /// </summary>
        Task<bool> UpdateWorkSpaceAsync(WorkSpace workSpace);

        /// <summary>
        /// 删除工作空间
        /// </summary>
        Task<bool> DeleteWorkSpaceAsync(int id);

        /// <summary>
        /// 获取最新修改的5条工作空间记录
        /// </summary>
        Task<List<WorkSpaceRecord>> GetRecentWorkSpaceRecordsAsync(int count = 5);

        /// <summary>
        /// 从KMACS系统获取完整的工作目录树
        /// </summary>
        Task<List<WorkSpaceNode>> GetFullWorkDirectoryTreeAsync();

        /// <summary>
        /// 根据工作空间节点筛选标注信息
        /// </summary>
        Task<List<PlateAnnotationInfo>> GetPlateAnnotationInfosByWorkSpaceNodeAsync(WorkSpaceNode node);

        /// <summary>
        /// 保存工作空间到本地配置
        /// </summary>
        Task SaveWorkSpaceToLocalConfigAsync(WorkSpace workSpace);

        /// <summary>
        /// 从本地配置加载工作空间
        /// </summary>
        Task<WorkSpace> LoadWorkSpaceFromLocalConfigAsync();

        /// <summary>
        /// 获取当前活动的工作空间
        /// </summary>
        WorkSpace GetCurrentWorkSpace();

        /// <summary>
        /// 设置当前活动的工作空间
        /// </summary>
        void SetCurrentWorkSpace(WorkSpace workSpace);
    }
} 